﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

/// <summary>
/// 关卡系统：订阅敌人死亡事件
/// </summary>
public class EnemyKilledObserverStageSystem:IGameEventObserver
{
    private EnemyKilledSubject mSubject;
    private StageSystem mStageSystem;
    public EnemyKilledObserverStageSystem(StageSystem ss)
    {
        mStageSystem = ss;
    }
    
    // 订阅行为
    public override void Update()
    {
        mStageSystem.countOfEnemyKilled = mSubject.killedCount;
        //Debug.Log("Update:" + mSubject.killedCount);
    }
    
    // 订阅 发布者
    public override void SetSubject(IGameEventSubject sub)
    {
        mSubject = sub as EnemyKilledSubject;
    }
}
